#include <iostream>
#include <set>
using namespace std;

int main() {
    int n,num,i;
    set<int> s; 
    set<int>::iterator it;
    while(cin>>n) {
        s.clear();
        for(i=0;i<n;++i) {
            cin >> num;
            s.insert(num);
        }
        i=(int) s.size();
        it = s.begin();
        cout << i << endl;
        while(i--) {
            cout << *it ;
            if(i>0)
                cout << " ";
            else 
                cout << endl;
            ++it;
        }
    }
    return 0;
}



